package com.zpark.service.impl;

import com.zpark.mapper.IRankingMapper;
import com.zpark.pojo.Ranking;
import com.zpark.service.IRankingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * service的实现类
 */
@Service
public class RankingServiceImpl implements IRankingService {

    // 自动注入mapper层
    @Autowired
    private IRankingMapper rankingMapper; // rankingMapper 它报错的话是启动类没有扫描mapper，要添加扫描注解

    @Override
    public List<Ranking> findAll() {
        return rankingMapper.selectAll();
    }

    @Override
    public Ranking findById(Integer id) {
        return rankingMapper.selectByPrimaryKey(id);
    }
}
